<?php
include("inc/onemli.php");

function goUrl($link) {
	echo "
        <script language=\"javascript\">goUrl('$link','_top');</script>
        ";
}
?>
<html>
<head>
<title>Linker url loader</title>
<!-- <SCRIPT language=javascript src="js/sozluk.js"></SCRIPT> -->
<script language=javascript>
	function goUrl(url,frm)
	{
        open(url,frm);
	}
</script>
</head>
<body>
<?php

$id = $_GET['id'];
$id = strip_tags($id);


$cumle = "SELECT * FROM link_url u, link_cat c WHERE u.urlCat = c.catID AND u.urlID = ".$id." AND c.type <= ".$_SESSION['kul-cesit']."";
$sorgu = mysql_query($cumle);

if(mysql_num_rows($sorgu)==1)
{
	$row = mysql_fetch_array($sorgu);
	
	$dt = date("Y.m.d H:i:s");
	$ip=$_SERVER['REMOTE_ADDR']; 
	mysql_query("INSERT INTO `link_log` (`urlID`,`urlName`,`urlAddr`,`urlCat`,`catID`,`catName`,`catLeft`,`catTop`,`catColor1`,`catColor2`,`type`,`catWidth`,`user`,`usertype`,`datetime`,`ipaddr`,`session`) VALUES('".$row['urlID']."', '".$row['urlName']."', '".$row['urlAddr']."', '".$row['urlCat']."', '".$row['catID']."', '".$row['catName']."', '".$row['catLeft']."', '".$row['catTop']."', '".$row['catColor1']."', '".$row['catColor2']."', '".$row['type']."', '".$row['catWidth']."','".$_SESSION['uid']."','".$_SESSION['kul-cesit']."','".$dt."','".$ip."','".session_id()."');");
	
	$link = $row['urlAddr'];
	goUrl($link);
}
else
{
	goUrl("http://www.sadikkuzu.net/link.php");
}




?>
</body>
</html>


